package cn.edu.scnu.thewonderofink.ui.dictionary

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.switchMap

class DictionaryViewModel : ViewModel() {

    private val baseLiveData = MutableLiveData<List<Int>>()

    val imageLiveData: LiveData<List<Int>> = baseLiveData.switchMap{
        MutableLiveData<List<Int>>().apply {
            value = it
        }
    }

    val imageList = ArrayList<Int>()

    fun setImageLiveData(imageList: List<Int>){
        baseLiveData.value = imageList
    }

}